﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmallERP.DAL
{
    public class Dalbase
    {
        public DataTable ExceSQL(string inSQL)
        {

            Database db = null;


            DataTable table = new DataTable();
            try
            {
                db = DatabaseFactory.CreateDatabase();

                DbCommand dbCommand = db.GetSqlStringCommand(inSQL);
                DataSet set = db.ExecuteDataSet(dbCommand);
                table = set.Tables[0];
            }
            catch
            {
                throw;
            }
            return table;
        }
        public DataSet ExceSQLDataSet(string inSQL)
        {

            Database db = null;

            DataSet set;

            try
            {
                db = DatabaseFactory.CreateDatabase();

                DbCommand dbCommand = db.GetSqlStringCommand(inSQL);
                set = db.ExecuteDataSet(dbCommand);

            }
            catch
            {
                throw;
            }
            return set;
        }
    }
}
